package com.newcapec.lesson2;

public class Demo1 {
    public static void main(String[] args) {
        Car car = new Car("red","123456");
        Driver driver1 = new Driver("张三","男",20,car);
        Driver driver2 = new Driver(driver1);
        System.out.println(driver1.equals(driver2));
        System.out.println(driver1);
        System.out.println(driver2);
        driver1.getCar().setColor("black");
        System.out.println("-------------------------------");
        System.out.println(driver1);
        System.out.println(driver2);
        System.out.println(driver1 == driver2);
        //不一样  一样   一样  不一样



    }
}
